<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>CRUD代码</title>
  <!-- 新 Bootstrap 核心 CSS 文件 -->
  <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
  <!-- 可选的Bootstrap主题文件（一般不用引入） -->
  <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
  <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
  <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
  <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
  <div class="row" style="margin-top:150px;">
    <div class="col-md-3 col-md-offset-3">
      <div class="panel panel-info">
        <div class="panel-heading">
          <h3 class="panel-title">新增<?php echo ($modelName); ?></h3>
        </div>
        <div class="panel-body">
          $<?php echo ($tableName); ?>Model = M('<?php echo ($modelName); ?>');<br/>
          <?php if(is_array($modelFields)): $i = 0; $__LIST__ = $modelFields;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; if(!in_array($vo, $noCodeArr)): ?>$<?php echo ($tableName); ?>Model-><?php echo ($vo); ?> = _;<br/><?php endif; endforeach; endif; else: echo "" ;endif; ?>
          $<?php echo ($tableName); ?>Model->create_time = time();<br/>
          $<?php echo ($tableName); ?>Model->add();
        </div>
      </div>
    </div>
    <div class="col-md-3">
      <div class="panel panel-info">
        <div class="panel-heading">
          <h3 class="panel-title">修改<?php echo ($modelName); ?></h3>
        </div>
        <div class="panel-body">
          $<?php echo ($tableName); ?>Model = M('<?php echo ($modelName); ?>');<br/>
          $<?php echo ($tableName); ?>Model->find($id);<br/>
          <?php if(is_array($modelFields)): $i = 0; $__LIST__ = $modelFields;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; if(!in_array($vo, $noCodeArr)): ?>$<?php echo ($tableName); ?>Model-><?php echo ($vo); ?> = _;<br/><?php endif; endforeach; endif; else: echo "" ;endif; ?>
          $<?php echo ($tableName); ?>Model->update_time = time();<br/>
          $<?php echo ($tableName); ?>Model->save();
        </div>
      </div>
    </div>
  </div>
  <hr/>
  <div class="row">
    <div class="col-md-3 col-md-offset-3">
      <div class="panel panel-info">
        <div class="panel-heading">
          <h3 class="panel-title">删除<?php echo ($modelName); ?></h3>
        </div>
        <div class="panel-body">
          $<?php echo ($tableName); ?>Model = M('<?php echo ($modelName); ?>');<br/>
          $<?php echo ($tableName); ?>Model->delete($id);<br/>
        </div>
      </div>
    </div>
    <div class="col-md-3">
      <div class="panel panel-info">
        <div class="panel-heading">
          <h3 class="panel-title">查询<?php echo ($modelName); ?></h3>
        </div>
        <div class="panel-body">
          $<?php echo ($tableName); ?>Model = M('<?php echo ($modelName); ?>');<br/>
          $list = $<?php echo ($tableName); ?>Model->select();<br/>
        </div>
      </div>
    </div>
  </div>
</body>
</html>